from ronglian_sms_sdk import SmsSDK #导入短信
accId = '8a216da87ba59937017bf7c663321526'
accToken = '16c8fd4b03d24388a534f5c48adfd5e8'
appId = '8a216da87ba59937017bf7c6641a152d'
def send_message(mobile, code, time):
    import json
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    datas = (code, time)
    resp = sdk.sendMessage(tid, mobile, datas)
    result = json.loads(resp)
    if result['statusCode'] == '000000':
        return 1
    return 2

from django_redis import get_redis_connection
def get_redis():
    conn = get_redis_connection()
    return conn